package com.zzld.modules.sys.action;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zzld.core.utils.MessageUtils;
import com.zzld.modules.common.dto.CommonJSON;
import com.zzld.modules.sys.service.IUserRoleService;

@Controller
@RequestMapping(value = "/sys/userRole")
public class UserRoleController {

	@Autowired
	private IUserRoleService roleService;
	
	@RequestMapping(value="/userjiao/quan")
	@ResponseBody
	public CommonJSON updatuser(HttpServletRequest request){
		String user_id= request.getParameter("id");
	    String ids = request.getParameter("ids");
	    CommonJSON paramJson = new CommonJSON();
		if(roleService.updatejiaose(user_id, ids)>0){
			paramJson.setMessage(MessageUtils.EDIT_SUCCESS);
			paramJson.setSuccess(true);
		}else{
			paramJson.setMessage(MessageUtils.EDIT_WARING);
			paramJson.setSuccess(false);
		}
		return paramJson;
	}
}
